Skip to content

test(NODE-7534): add prose tests for retry behavior with mixed overload/non-overload errors#4921

Merged
PavelSafronov merged 6 commits intomainfrom
NODE-7534
Apr 24, 2026
Merged

test(NODE-7534): add prose tests for retry behavior with mixed overload/non-overload errors#4921
PavelSafronov merged 6 commits intomainfrom
NODE-7534

Conversation

@nbbeeken
Copy link
Copy Markdown
Contributor

Description

Summary of Changes

  • Add 4 new prose tests per spec commit 7039e69
  • Test 4 (reads/writes): Verify MAX_RETRIES applies to all errors after overload
  • Test 5 (reads/writes): Verify backoff only applies to overload errors
  • Uses mocking pattern consistent with existing prose tests
Notes for Reviewers

WIP

What is the motivation for this change?

Coverage reccomended by spec

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

…-overload errors

- Add 4 new prose tests per spec commit 7039e69
- Test 4 (reads/writes): Verify MAX_RETRIES applies to all errors after overload
- Test 5 (reads/writes): Verify backoff only applies to overload errors
- Uses mocking pattern consistent with existing prose tests
@nbbeeken nbbeeken marked this pull request as ready for review April 16, 2026 17:15
@nbbeeken nbbeeken requested a review from a team as a code owner April 16, 2026 17:15
Copilot AI review requested due to automatic review settings April 16, 2026 17:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new prose integration tests to validate the driver’s retry behavior when encountering an initial SystemOverloadedError followed by subsequent non-overload retryable errors, per the referenced spec guidance.

Changes:

  • Add new retryable-writes prose cases to verify MAX_RETRIES is honored across mixed overload/non-overload retryable write errors.
  • Add new retryable-reads prose cases to verify MAX_RETRIES is honored across mixed overload/non-overload retryable read errors.
  • Add timing-based assertions (via measureDuration) to ensure backoff is only applied to overload-labeled errors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/integration/retryable-writes/retryable_writes.spec.prose.test.ts Adds Case 4/5 prose tests for mixed overload/non-overload retry behavior and backoff timing for retryable writes.
test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Adds new prose suites to validate max-retry behavior and backoff timing for retryable reads under mixed error-label sequences.

Comment thread test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Outdated
Comment thread test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Outdated
Comment thread test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Outdated
@tadjik1 tadjik1 self-assigned this Apr 20, 2026
@tadjik1 tadjik1 added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Apr 20, 2026
@tadjik1 tadjik1 added the Team Review Needs review from team label Apr 21, 2026
@tadjik1 tadjik1 removed their assignment Apr 21, 2026
@tadjik1 tadjik1 removed Primary Review In Review with primary reviewer, not yet ready for team's eyes Team Review Needs review from team labels Apr 21, 2026
@PavelSafronov PavelSafronov self-assigned this Apr 21, 2026
@PavelSafronov PavelSafronov added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Apr 21, 2026
PavelSafronov
PavelSafronov previously approved these changes Apr 21, 2026
Comment thread test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new prose tests to validate retry/backoff behavior when an initial SystemOverloadedError is followed by retryable non-overload errors, aligning with the retryable reads/writes prose spec scenarios.

Changes:

  • Add “Case 4” tests asserting MAX_RETRIES + 1 attempts occur even when later retryable errors are not overload errors (reads + writes).
  • Add “Case 5” tests intended to assert backoff is applied only for overload errors (reads + writes).
  • Introduce measureDuration usage to time retry sequences for the backoff assertions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/integration/retryable-writes/retryable_writes.spec.prose.test.ts Adds two new prose cases (max retries after overload; backoff only for overload) using Server.prototype.command stubbing + timing.
test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Adds two new prose describes for the same behaviors for reads, including new imports and per-describe client lifecycle hooks.

Comment thread test/integration/retryable-writes/retryable_writes.spec.prose.test.ts Outdated
Comment thread test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Outdated
Comment thread test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Outdated
@dariakp dariakp added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Apr 22, 2026
Copy link
Copy Markdown
Contributor Author

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on the changes

@PavelSafronov PavelSafronov merged commit 1e0dfda into main Apr 24, 2026
32 checks passed
@PavelSafronov PavelSafronov deleted the NODE-7534 branch April 24, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team Review Needs review from team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants